
import time

from selenium import webdriver
from selenium.webdriver import Keys
from selenium.webdriver.common.by import By

chrome=webdriver.Chrome("chromedriver.exe")
driver=webdriver.chrome()
chrome.get("https://www.baidu.com/")

el=chrome.find_element(By.ID,"kw")\

#发送信息
el.send_keys("nihao")
#全选
el.send_keys(Keys.CONTROL,"a")
time.sleep(3)
#复制
el.send_keys(Keys.CONTROL,"c")
time.sleep(3)
#删除  注意：如果不是全选 删除只会删除一个子符
el.send_keys(Keys.BACK_SPACE)
time.sleep(3)
#粘贴
el.send_keys(Keys.CONTROL,"v")
time.sleep(3)